package structural.facade;

import lombok.extern.slf4j.Slf4j;

/**
 * @author binbin
 * @since 2022/10/6 17:09
 */
@Slf4j
public class OrderPhoneFacade {

    private OrderService orderService = new OrderService();
    private PaymentService paymentService = new PaymentService();
    private ShippingService shippingService = new ShippingService();
    private StorageService storageService = new StorageService();

    public void orderPhone(String phone) {
        if (orderService.order()) {
            if (paymentService.pay()) {
                if (storageService.checkStorage()) {
                    if (shippingService.ship()) {
                        log.info("成功订购{}", phone);
                    }
                }
            }
        }
    }
}
